package com.sljy.hzk.room.dao;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;

import com.sljy.hzk.entity.TaskBodyEntity;

import java.util.List;

@Dao
public interface TaskBodyDao {
    /**
     * 添加一个数据
     */
    @Insert
    void insert(TaskBodyEntity userEntity);

    @Update
    void update(TaskBodyEntity userEntity);

    @Delete
    void delete(TaskBodyEntity userEntity);

    @Query("SELECT  * FROM TaskBodyEntity")
    List<TaskBodyEntity> get();

    @Query("SELECT  * FROM TaskBodyEntity where userID = :userID")
    List<TaskBodyEntity> getByUserId(Long userID);


    @Query("SELECT  * FROM TaskBodyEntity where workPlanState = :id")
    TaskBodyEntity getById(int id);
}
